package cn.itlaobing.dao;


import cn.itlaobing.model.UserModel;
import org.apache.commons.dbutils.ResultSetHandler;

import java.sql.ResultSet;
import java.sql.SQLException;



/**
 * Created by Administrator on 2017/11/3 0003.
 */
public class UserResultHandler implements ResultSetHandler<UserModel> {
    @Override
    public UserModel handle(ResultSet resultSet) throws SQLException {
        if(resultSet.next()){
            UserModel user=new UserModel();
            user.setUserName(resultSet.getString("username"));
            user.setUserPass(resultSet.getString("userpass"));
            return user;
        }
        return null;

    }


}
